package com.qing.expert.modules.expert.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Accessors(chain = true)
@TableName(value = "expert", autoResultMap = true)
public class Expert {

    @TableId(type = IdType.ASSIGN_ID)
    private String expertId;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;

    /**
     * 分类ID
     */
    @TableField("category_id")
    private String categoryId;

    /**
     * 达人介绍
     */
    @TableField("description")
    private String description;

    /**
     * 资质证明图片URL
     */
    @TableField(value = "certificate_images", typeHandler = JacksonTypeHandler.class)
    private List<String> certificateImages;

    /**
     * 评分
     */
    @TableField("rating")
    private Double rating;

    /**
     * 已完成订单数
     */
    @TableField("completed_orders")
    private Integer completedOrders;

    /**
     * 是否忙碌
     */
    @TableField("is_busy")
    private Boolean isBusy;

    /**
     * 状态：1=正常，2=暂停服务，3=封禁
     */
    @TableField("status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}